#ifndef GRIDMAP_H
#define GRIDMAP_H

#include <SFML/Graphics.hpp>

#include <vector>
#include <fstream>

#include "..\ImageCache.h"

class GridMap: public sf::Drawable, public sf::Transformable
{
    public:		
		static GridMap& getInstance ();

		void loadMap (std::ifstream& ifstream, Image::TileTexture tileTexture);

		const std::vector<std::vector<int>>& getBaseLayer () const;
		const std::vector<std::vector<int>>& getMiscLayer () const;

		bool processLeftClickEvent (const sf::Vector2i& pos) const;
		bool processRightClickEvent (const sf::Vector2i& pos) const;

    protected:
    private:
		std::vector<std::vector<int>> baseLayer;
		std::vector<std::vector<int>> miscLayer;
		sf::VertexArray vertices;
		sf::Texture*	mapTexture;

		GridMap ();

		virtual void draw (sf::RenderTarget& target, sf::RenderStates states) const;
		
};

#endif // GRIDMAP_H
